import ajax from './request'

// 1. 博客列表接口  分页  get
export const FetchGetBlogsList = ({ page, size }) => {
  return ajax.get('/api/blogs', {
    params: {page, size}
  })
}
// 2. 详情接口 get
export const FetchGetBlogsDetail = ({ id }) => {
  return ajax.get(`/api/blogs/detail/${id}`)
}

// 2. 博客添加接口
export const FetchAddBlogsList = ({ title, content, author }) => {
  return ajax.post('/api/blogs', { title, content, author })
}

// 3. 博客修改接口
export const FetchUpdateBlogsList = ({ title, content, author, id }) => {
  return ajax.put(`/api/blogs/${id}`, { title, content, author })
}

// 4. 博客删除接口
export const FetchDeleteBlogsList = () => {
  return ajax.delete(`/api/blogs/${id}`)
}
